forum

home / developersection / forums / help with nullreference exception in c#

Help with NullReference exception in C#

Anonymous User 2098 23-Aug-2014

The following is a web method that is called from ajax, I have verified with firebug that the script is indeed passing two string values to my method:

public string DealerLogin_Click(string name, string pass)
{
    string g="adf";
    if (name == "w" && pass == "w")
    {
        HttpContext.Current.Session["public"] = "pub";
        g= "window.location = '/secure/Default.aspx'";
    }
    return g;
}

 If I delete the if block then I don't get an error back from the server. 


c# c# 
Updated on 23-Aug-2014

I am a content writter !


Message
Can you answer this question?

Answer

1 Answers

Liked By